package com.example.demo.service;

import com.example.demo.mapper.CollegeDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hongjinhui
 */
@Service
@Slf4j
public class CollegeService {
    @Autowired
    private CollegeDao collegeDao;

    /**
     * 查询所有学院名
     */
    public List<String> getAllCollegeName() {
        return collegeDao.queryAllCollegeName();
    }

    /**
     * 通过学院名查询所有年级
     */
    public List<String> getAllGradeByCollegeName(String collegeName) {
        return collegeDao.queryAllGradeByCollegeName(collegeName);
    }

    /**
     * 通过学院名和年级查询所有班级
     */
    public List<String> getAllClassByCollegeNameAndGrade(String collegeName, String grade) {
        return collegeDao.queryAllClassByCollegeNameAndGrade(collegeName, grade);
    }
}

